From: Andreas Schwab Date: Sun, 29 Apr 2007 16:07:57 +0000 (+0000) Subject: (VECSIZE): Use OFFSETOF. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18965 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4256e4a4609c74bc70888abd16d239a7db3fcfb0;p=emacs.git (VECSIZE): Use OFFSETOF. --- diff --git a/src/lisp.h b/src/lisp.h index 40ed548e494..d92f4045742 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -735,9 +735,9 @@ struct Lisp_Vector /* If a struct is made to look like a vector, this macro returns the length of the shortest vector that would hold that struct. */ -#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector) \ - - sizeof (Lisp_Object)) \ - + sizeof(Lisp_Object) - 1) /* round up */ \ +#define VECSIZE(type) ((sizeof (type) \ + - OFFSETOF (struct Lisp_Vector, contents[0]) \ + + sizeof(Lisp_Object) - 1) /* round up */ \ / sizeof (Lisp_Object)) /* Like VECSIZE, but used when the pseudo-vector has non-Lisp_Object fields